package com.party.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.business.domain.TArticleCpType;
import com.party.business.mapper.TArticleCpTypeMapper;
import com.party.business.service.ITArticleCpTypeService;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 产品分类Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-08
 */
@Service
public class TArticleCpTypeServiceImpl extends ServiceImpl<TArticleCpTypeMapper, TArticleCpType>  implements ITArticleCpTypeService
{
    @Autowired
    private TArticleCpTypeMapper tArticleCpTypeMapper;

    /**
     * 查询产品分类
     *
     * @param id 产品分类主键
     * @return 产品分类
     */
    @Override
    public TArticleCpType selectTArticleCpTypeById(String id)
    {
        return tArticleCpTypeMapper.selectTArticleCpTypeById(id);
    }

    /**
     * 查询产品分类列表
     *
     * @param tArticleCpType 产品分类
     * @return 产品分类
     */
    @Override
    public List<TArticleCpType> selectTArticleCpTypeList(TArticleCpType tArticleCpType)
    {
        return tArticleCpTypeMapper.selectTArticleCpTypeList(tArticleCpType);
    }

    /**
     * 新增产品分类
     *
     * @param tArticleCpType 产品分类
     * @return 结果
     */
    @Override
    public int insertTArticleCpType(TArticleCpType tArticleCpType)
    {
                tArticleCpType.setCreateTime(DateUtils.getNowDate());
            return tArticleCpTypeMapper.insertTArticleCpType(tArticleCpType);
    }

    /**
     * 修改产品分类
     *
     * @param tArticleCpType 产品分类
     * @return 结果
     */
    @Override
    public int updateTArticleCpType(TArticleCpType tArticleCpType)
    {
                tArticleCpType.setUpdateTime(DateUtils.getNowDate());
        return tArticleCpTypeMapper.updateTArticleCpType(tArticleCpType);
    }

    /**
     * 批量删除产品分类
     *
     * @param ids 需要删除的产品分类主键
     * @return 结果
     */
    @Override
    public int deleteTArticleCpTypeByIds(String[] ids)
    {
        return tArticleCpTypeMapper.deleteTArticleCpTypeByIds(ids);
    }

    /**
     * 删除产品分类信息
     *
     * @param id 产品分类主键
     * @return 结果
     */
    @Override
    public int deleteTArticleCpTypeById(String id)
    {
        return tArticleCpTypeMapper.deleteTArticleCpTypeById(id);
    }
}
